import { createRouter, createWebHistory } from "vue-router";
import Login from "@/views/Login.vue";

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),// import.meta.env.BASE_URL = '/'
    // 路由映射
    routes: [
        {
            path: '/login',
            name: 'login',
            // component: () => import('./views/Login.vue')
            component: Login
        },
        {
            path: '/register',
            name: 'register',
            component: () => import('@/views/Register.vue')
        },
        {
            path: '/',
            name: 'mainpage',
            component: () => import('@/views/MainPage.vue')
        }
    ]
})

export default router;